<template>
  <h1>生命周期</h1>
  <button @click="flag = !flag">展示/隐藏 子组件</button>
  <hr>
  <btn v-if="flag"></btn>
</template>

<script setup>
import btn from './components/btn.vue';
import { ref } from "vue"

const flag = ref(true)
</script>